package cn.miju.ser.unionpay.vo;

import cn.miju.ser.common.vo.BaseInVO;
import com.alibaba.fastjson2.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * <pre>
 * 扫码支付下单
 * </pre>
 *
 * @author zhuming
 * @version 1.0.0
 * @since 2023-02-28 22:09
 */
@Data
@ApiModel
@EqualsAndHashCode(callSuper = true)
public class UpCreateQrcodeOrderInVO extends BaseInVO {
    /**
     * 商户订单号
     */
    @ApiModelProperty(value = "商户订单号", required = true)
    @NotBlank(message = "传入商户订单号不能为空")
    @Length(max = 50, message = "商户订单号长度最大不超过50")
    @JSONField(name = "out_trade_no", ordinal = 1)
    private String outTradeNo;
    /**
     * 订单总金额，单位：分
     */
    @ApiModelProperty(value = "订单总金额，单位：分", required = true)
    @NotNull(message = "传入订单总金额不能为空")
    @Min(value = 1, message = "传入订单总金额不能小于1")
    @JSONField(name = "total_amount", ordinal = 2)
    private Integer totalAmount;
    /**
     * 订单标题
     */
    @ApiModelProperty(value = "订单标题", required = true)
    @JSONField(ordinal = 3)
    @NotBlank(message = "传入订单标题不能为空")
    private String title;
    /**
     * 订单描述
     */
    @ApiModelProperty(value = "订单描述")
    @JSONField(ordinal = 4)
    private String description;
    /**
     * 二维码失效时间;单位：秒
     * 传空默认1天
     */
    @ApiModelProperty(value = "二维码失效时间;单位：秒;传空默认1天")
    @JSONField(name = "time_expire", ordinal = 5)
    private Integer timeExpire;
}
